//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//     Filename: CSPXMLTranslator.h                                         //
//  Create date: July 6, 2004                                               //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//                                                                          //
//  Description: This file describes the CSPXMLTranslator class.  This class//
//                is a protocol translator that translates from the RTG     //
//                Caribbean Stud Poker protocol to XML and back.            //
//                                                                          //
//////////////////////////////////////////////////////////////////////////////
//       Copyright (c) 2004 - Realtime Gaming.  All rights reserved.        //
//////////////////////////////////////////////////////////////////////////////

#ifndef __CSP_XML_TRANSLATOR__
#define __CSP_XML_TRANSLATOR__

#include "XMLTranslator.h"
#include "CaribbeanCommon.h"

//////////////////////////////////////////////////////////////////////////////
// CSPXMLTranslator Class
//////////////////////////////////////////////////////////////////////////////
class CSPXMLTranslator : public XMLTranslator
{
public:
    CSPXMLTranslator( Server* pServer, Connection* pParent );
    virtual ~CSPXMLTranslator();

    // Public Interface
    virtual bool8  TranslateIncomingMessage( uint8* pGameInBuff,  uint32 nGameInBuffSize, uint8* pBuff, uint32 nOutBuffSize );
    virtual uint32 TranslateOutgoingMessage( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize, uint32 nTotalGameBytes );

protected:
	// Incoming
	bool8 TranslateInLogin  ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInDeal   ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInFold   ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInRaise  ( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );
	bool8 TranslateInJackpot( XMLDoc* pDoc, uint8* pGameInBuff,  uint32 nGameInBuffSize );

	// Outgoing
	bool8 TranslateOutLogin   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutDeal    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutJackpot ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutFinished( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutError   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    // kharmon.  07-16-07.  Adding Caribbean Hold'em to flash interface.
    bool8 TranslateOutCSLogin   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutCSDeal    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutCSFinished( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    // kharmon.  07-16-07.  Adding Caribbean Hold'em to flash interface.
    bool8 TranslateOutCHLogin   ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutCHDeal    ( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );
	bool8 TranslateOutCHFinished( uint8* pOutBuff, uint32 nOutBuffSize, uint8* pGameOutBuff, uint32 nGameOutBuffSize );

    // kharmon.  07-16-07.  Adding Caribbean Hold'em to flash interface.
    CaribbeanGameId m_eGameId;

};

#endif //#ifndef __CSP_XML_TRANSLATOR__